Skip to content

Demote private Make/Mise targets and fix xterm dimensions TypeError#15

Merged
MelbourneDeveloper merged 9 commits intomainfrom
issue-13
Apr 19, 2026
Merged

Demote private Make/Mise targets and fix xterm dimensions TypeError#15
MelbourneDeveloper merged 9 commits intomainfrom
issue-13

Conversation

@MelbourneDeveloper
Copy link
Copy Markdown
Collaborator

TLDR;

Closes #13. Make and Mise targets prefixed with _ are now sorted below public targets, separated by a divider, and rendered with a muted icon/label plus a "private" description marker. Also fixes an intermittent xterm dimensions TypeError by waiting for the shell process to spawn before sendText.

Details

What Was Added

  • src/tree/PrivateTaskDecorationProvider.ts — new FileDecorationProvider registered on the commandtree-private URI scheme that paints private-task labels with descriptionForeground. Exports buildPrivateTaskUri(taskId).
  • src/models/TaskItem.tsisPrivateTask, isPhonyTask helpers, an optional isPhony flag on CommandItem/MutableCommandItem, and resourceUri support on CommandTreeItem (extracted into applyOptionalProps to keep the constructor lean).
  • src/discovery/make.ts.PHONY: parser (parsePhonyTargets, with line-continuation support) that tags targets with isPhony: true.
  • src/tree/nodeFactory.tscreateTaskNodes(tasks) groups tasks and injects a createDividerNode between the last public task and the first private one. Private tasks get a muted ThemeIcon, a private resourceUri, and a private marker appended to their description.
  • src/CommandTreeProvider.ts — comparators comparePrivateTasks, compareHelpTasks, comparePhonyTasks, compareMakeTaskPriority layered into all three sort modes (folder, type, name). Private tasks sort last; help pins to the top of Make targets; phony targets come before non-phony ones.
  • E2E tests in src/test/e2e/treeview.e2e.test.ts:
    • Private Make And Mise Tasks — writes fixture Makefile and mise.toml with mixed public/private targets, asserts divider position, ordering, description contains private, icon color descriptionForeground, and resourceUri.scheme === "commandtree-private".
    • Make Target Conventions — asserts help is pinned first, phony public targets outrank non-phony ones, and pattern rules (%.o) / dot-prefixed special targets (.DEFAULT) stay hidden.

What Was Changed

  • src/runners/TaskRunner.tsSHELL_INTEGRATION_TIMEOUT_MS raised from 50 ms to 500 ms and the fallback path now awaits terminal.processId before calling sendText, avoiding the xterm dimensions TypeError when the viewport hasn't been laid out yet. Added exhaustive never-typed default branch in formatParamValue.
  • src/extension.ts — registers PrivateTaskDecorationProvider via vscode.window.registerFileDecorationProvider; returns undefined explicitly when there's no workspace root.
  • src/discovery/docker.ts — destructuring cleanup in parseDockerComposeServices.
  • src/test/e2e/execution.e2e.test.tsrunInCurrentTerminal tests now (a) write a marker file via the shell and assert the file exists + contains the echoed text (proves the command actually ran, not just that a terminal appeared), (b) watch VS Code's renderer.log and assert no dimensions/TypeError lines are written during the command, (c) assert the active terminal name and exit status. Timeouts bumped to 20 s to match the longer shell-integration wait.
  • Skill docs (.claude/skills/*/SKILL.md), .github/workflows/ci.yml, Makefile, coverage-thresholds.json, eslint.config.mjs, Agents.md, Claude.md, .vscode/extensions.json, tools/check-coverage.mjs — repo-standards polish bundled in.

What Was Deleted

Nothing of substance deleted from runtime code — some destructuring simplifications and one allowed-tools line removed from submit-pr SKILL frontmatter.

How Tests Prove It Works

  • src/test/e2e/treeview.e2e.test.ts::Private Make And Mise Tasks::make private targets sort after public ones and render muted — asserts folder children are [alpha_public, zeta_public, ─────, _beta_private, _omega_private], each private item has description containing private, icon ThemeColor.id === "descriptionForeground", and resourceUri.scheme === "commandtree-private".
  • ...::mise private tasks sort after public ones and render muted — same assertions for mise.toml.
  • ...::Make Target Conventions::make help is pinned to the top, phony targets sort before non-phony ones, and special targets stay hidden — asserts folder children are [help, build, aaa_file, ─────, _private] and %.o / .DEFAULT are absent.
  • src/test/e2e/execution.e2e.test.ts::runInCurrentTerminal creates terminal when none exists and ...reuses existing active terminal — assert the marker file is written and renderer.log contains zero dimensions/TypeError lines during the run, proving sendText no longer hits the xterm layout race.

Spec/Doc Changes

  • .claude/skills/*/SKILL.md updated to reference make test (fail-fast + coverage threshold) and the repo's actual Make targets — no behaviour spec changes.

Breaking Changes

None. New data (isPhony, resourceUri, divider node, commandtree-private URI scheme) is additive. Sort order changes are a UX improvement within existing sort modes and do not alter any public API.

🤖 Generated with Claude Code

abdushakoor12 and others added 9 commits April 17, 2026 12:34
# TLDR;

It treats Make and Mise private tasks more like users expect. _-prefixed
tasks are grouped below public tasks, separated by a divider, and
visually de-emphasized. For Makefiles, help is prioritized to the top
and .PHONY targets are preferred ahead of non-phony targets, while
dot-prefixed special targets and % pattern rules remain hidden. Closes
#13

# Details

For Make and Mise:
- _-prefixed tasks are recognized as private/internal
- private tasks are sorted below public tasks
- a divider is inserted between public and private groups
- private tasks are rendered with a muted icon treatment and marked as
private in the item description

For Make specifically:

- .PHONY declarations are parsed during discovery
- discovered Make targets now carry phony metadata
- help is pinned to the top of the Make group
- phony public targets sort ahead of non-phony public targets
- dot-prefixed special targets such as .PHONY and .DEFAULT remain hidden
- % pattern rules remain hidden
- The result is a tree that better reflects common GNU Make and Mise
conventions, reduces accidental clicks on internal tasks, and makes the
primary entry points easier to scan.

# How do the tests prove the change works

The E2E coverage in src/test/e2e/treeview.e2e.test.ts exercises the
rendered tree, not just internal helpers.

The `Private Make And Mise Tasks` tests create temporary Make and Mise
files and verify that:

- public tasks appear before private _ tasks
- a divider row appears between the groups
- private tasks are still present after the divider
- private tasks use the muted icon styling

The `Make Target Conventions` test verifies that:

- help is first
- phony public targets sort before non-phony public targets
- private targets appear below the divider
- % pattern rules are hidden
- dot-prefixed special targets are hidden
@MelbourneDeveloper MelbourneDeveloper merged commit 4c0172a into main Apr 19, 2026
2 checks passed
@MelbourneDeveloper MelbourneDeveloper deleted the issue-13 branch April 19, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make/Mise: Demote private (_-prefixed) targets visually and sort them below public targets

2 participants